package com.zzq.account.feign;

import com.zzq.account.entities.dto.AccountDTO;
import com.zzq.account.feign.impl.AccountFeignImpl;
import com.zzq.common.result.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "account-service", fallbackFactory = AccountFeignImpl.class)
public interface AccountFeign {
    @PostMapping("/account/insert")
    ResultData insert(@RequestBody AccountDTO accountDTO);

    @PostMapping("/account/delete")
    ResultData delete(@RequestParam("accountCode") String accountCode);

    @PostMapping("/account/update")
    ResultData update(@RequestBody AccountDTO accountDTO);

    @GetMapping("/account/getByCode/{accountCode}")
    ResultData getByCode(@PathVariable(value = "accountCode") String accountCode);
}
